home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / !Interfaces / Universal Interfaces 2.0a1 / PInterfaces / CommResources.p < prev    next >
Encoding:
Text File  |  1994-07-17  |  3.8 KB  |  116 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CommResources.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a1.  ETO #15, MPW prerelease.  Sunday, July 17, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT CommResources;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __COMMRESOURCES__}
  27. {$SETC __COMMRESOURCES__ := 1}
  28.  
  29. {$I+}
  30. {$SETC CommResourcesIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$IFC UNDEFINED __OSUTILS__}
  35. {$I OSUtils.p}
  36. {$ENDC}
  37. {    Types.p                                                        }
  38. {        ConditionalMacros.p                                        }
  39. {    MixedMode.p                                                    }
  40.  
  41. {$PUSH}
  42. {$ALIGN MAC68K}
  43. {$LibExport+}
  44.  
  45. CONST
  46. {    tool classes (also the tool file types)    }
  47.     classCM                        = 'cbnd';
  48.     classFT                        = 'fbnd';
  49.     classTM                        = 'tbnd';
  50.  
  51. {    version of the Comm Resource Manager    }
  52.     curCRMVersion                = 2;
  53. { constants general to the use of the Communications Resource Manager }
  54.     crmType                        = 9;                            { queue type    }
  55.     crmRecVersion                = 1;                            { version of queue structure }
  56. {    error codes }
  57.     crmGenericError                = -1;
  58.     crmNoErr                    = 0;
  59.  
  60. { data structures general to the use of the Communications Resource Manager }
  61.     
  62. TYPE
  63. CRMErr = OSErr;
  64.  
  65.     CRMRec = RECORD
  66.         qLink:                    QElemPtr;                                {reserved}
  67.         qType:                    INTEGER;                                {queue type -- ORD(crmType) = 9}
  68.         crmVersion:                INTEGER;                                {version of queue element data structure}
  69.         crmPrivate:                LONGINT;                                {reserved}
  70.         crmReserved:            INTEGER;                                {reserved}
  71.         crmDeviceType:            LONGINT;                                {type of device, assigned by DTS}
  72.         crmDeviceID:            LONGINT;                                {device ID; assigned when CRMInstall is called}
  73.         crmAttributes:            LONGINT;                                {pointer to attribute block}
  74.         crmStatus:                LONGINT;                                {status variable - device specific}
  75.         crmRefCon:                LONGINT;                                {for device private use}
  76.     END;
  77.     CRMRecPtr = ^CRMRec;
  78.  
  79.  
  80. FUNCTION InitCRM: CRMErr;
  81. FUNCTION CRMGetHeader: QHdrPtr;
  82. PROCEDURE CRMInstall(crmReqPtr: CRMRecPtr);
  83. FUNCTION CRMRemove(crmReqPtr: CRMRecPtr): OSErr;
  84. FUNCTION CRMSearch(crmReqPtr: CRMRecPtr): CRMRecPtr;
  85. FUNCTION CRMGetCRMVersion: INTEGER;
  86. FUNCTION CRMGetResource(theType: ResType; theID: INTEGER): Handle;
  87. FUNCTION CRMGet1Resource(theType: ResType; theID: INTEGER): Handle;
  88. FUNCTION CRMGetIndResource(theType: ResType; index: INTEGER): Handle;
  89. FUNCTION CRMGet1IndResource(theType: ResType; index: INTEGER): Handle;
  90. FUNCTION CRMGetNamedResource(theType: ResType; name: ConstStr255Param): Handle;
  91. FUNCTION CRMGet1NamedResource(theType: ResType; name: ConstStr255Param): Handle;
  92. PROCEDURE CRMReleaseResource(theHandle: Handle);
  93. FUNCTION CRMGetToolResource(procID: INTEGER; theType: ResType; theID: INTEGER): Handle;
  94. FUNCTION CRMGetToolNamedResource(procID: INTEGER; theType: ResType; name: ConstStr255Param): Handle;
  95. PROCEDURE CRMReleaseToolResource(procID: INTEGER; theHandle: Handle);
  96. FUNCTION CRMGetIndex(theHandle: Handle): LONGINT;
  97. FUNCTION CRMLocalToRealID(bundleType: ResType; toolID: INTEGER; theType: ResType; localID: INTEGER): INTEGER;
  98. FUNCTION CRMRealToLocalID(bundleType: ResType; toolID: INTEGER; theType: ResType; realID: INTEGER): INTEGER;
  99. FUNCTION CRMGetIndToolName(bundleType: OSType; index: INTEGER; VAR toolName: Str255): OSErr;
  100. FUNCTION CRMFindCommunications(VAR vRefNum: INTEGER; VAR dirID: LONGINT): OSErr;
  101. FUNCTION CRMIsDriverOpen(driverName: ConstStr255Param): BOOLEAN;
  102. FUNCTION CRMParseCAPSResource(theHandle: Handle; selector: ResType; VAR value: LONGINT): CRMErr;
  103. FUNCTION CRMReserveRF(refNum: INTEGER): OSErr;
  104. FUNCTION CRMReleaseRF(refNum: INTEGER): OSErr;
  105.  
  106. {$ALIGN RESET}
  107. {$POP}
  108.  
  109. {$SETC UsingIncludes := CommResourcesIncludes}
  110.  
  111. {$ENDC} {__COMMRESOURCES__}
  112.  
  113. {$IFC NOT UsingIncludes}
  114.  END.
  115. {$ENDC}
  116.